<?php
namespace app\common\model;
use think\Model;
use think\Db;
/**
 * 工单-预约时间段
 * @author lcx
 *
 */
class WorkOrderTimeModel extends Model{
    protected $name = 'work_order_time';
    /**
     * @desc   添加
     * @param  无
     * @date   2018-08-15
     * @author lcx
     * @param  [type]     $data [description]
     * @return [type]           [description]
     */
    public function add($data)
	{
        $id = $this->insertGetId($data);
        // 判断结果 并返回
        if ($id == false) {
            return false;
        }
        return $user_id;
	}	
	/**
	 * @desc   查询单条数据
	 * @param  无
	 * @date   2018-08-15
	 * @author lcx
	 * @param  [type]     $map   [description]
	 * @param  string     $field [description]
	 * @return [type]            [description]
	 */
	public function getOne($map,$field='*'){
		return $this->where($map)->field($field)->find();
	}
    /**
     * @desc   查询所有
     * @param  无
     * @date   2018-09-05
     * @author lcx
     * @param  array      $where [description]
     * @param  string     $field [description]
     * @param  array      $join  [description]
     * @return [type]            [description]
     */
    public function getAll($where = [],$field = '*',$join=[])
    {
        $data = $this->join($join)
                ->field($field)             
                ->where($where)         
                ->select();
        return $data;
    }
}